package com.shixj.ef.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by shixj on 2018/1/15.
 */
public class FetchHelper {
    public  static  String subByRegex(String sourceStr,String regex,int index){
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(sourceStr);
        String res="";
        while(matcher.find()){
            res=matcher.group(index);
            break;
        }

        return res;
    }
}
